import request from '@/util/requests.ts'
import { SimpleCaptchaRequestData } from '@/api/captcha/types.ts'

enum Captcha_Api {
    GET_SIMPLE_CAPTCHA_DATA = "/simple/captcha/info",
    VERIFY_SIMPLE_CAPTCHA = "/simple/captcha/verify",

    GET_BLOCK_PUZZLE_CAPTCHA = "/block/puzzle/info",
    VERIFY_BLOCK_PUZZLE_CAPTCHA = "/block/puzzle/verify"
}

// 获取simple captcha code 信息
export const getSimpleCaptchaInfo = () => request.get(Captcha_Api.GET_SIMPLE_CAPTCHA_DATA)

// 验证simple captcha code 信息
export const verifySimpleCaptchaInfo = (data: SimpleCaptchaRequestData) => request.post(Captcha_Api.VERIFY_SIMPLE_CAPTCHA, data)

// 滑块验证
export const getBlockPuzzleCaptchaInfo = () => request.get(Captcha_Api.GET_BLOCK_PUZZLE_CAPTCHA)

export const verifyBlockPuzzleCaptchaInfo = (data: any) => request.post(Captcha_Api.VERIFY_BLOCK_PUZZLE_CAPTCHA, data)
